<%-title 'Moderator log' %>
<%-description 'List of actions taken by moderators' %>

<table class="text-content">
	<thead>
		<tr>
			<th>Date</th>
			<th>Moderator</th>
			<th>Item</th>
			<th>Action</th>
			<th>Reason</th>
		</tr>
	</thead>
	<% @actions.each do |action| %>
		<tr>
			<td><%=markup_date action.created_at%></td>
			<td><%=link_to action.moderator.name, action.moderator%></td>
			<td>
				<% if !action.script.nil? %>
					Script: <%=link_to action.script.name(I18n.locale), action.script%>
				<% elsif !action.script_id.nil? %>
					(Deleted script <%=action.script_id%>)
				<%end%>
				<%if !action.user.nil?%>User: <%=link_to action.user.name, action.user%><%end%>
			</td>
			<td><%=action.action%></td>
			<td><%=action.reason%></td>
		</tr>
	<% end %>
</table>

<%= will_paginate @actions %>
